﻿using System;

namespace AvaloniaApplicationDemo.Models;

public class ModbusDeviceData
{
    public DateTime Timestamp { get; set; }


    /// <summary>
    /// 电压设置
    /// </summary>
    public ushort VoltageSetting { get; set; }

    /// <summary>
    /// 电流设置
    /// </summary>
    public ushort CurrentSetting { get; set; }

    /// <summary>
    /// 输出电压
    /// </summary>
    public ushort OutputVoltage { get; set; }

    /// <summary>
    /// 输出电流
    /// </summary>
    public ushort OutputCurrent { get; set; }

    /// <summary>
    /// 输出功率显示值
    /// </summary>
    public ushort OutputPower { get; set; }

    /// <summary>
    /// 输入电压显示值
    /// </summary>
    public ushort InputVoltage { get; set; }

    /// <summary>
    /// 输出AH (低16位+高16位)
    /// </summary>
    public uint OutputAH { get; set; }

    /// <summary>
    /// 输出WH (低16位+高16位)
    /// </summary>
    public uint OutputWH { get; set; }

    /// <summary>
    /// 输出开启时长
    /// </summary>
    public ushort OutputHours { get; set; }

    /// <summary>
    /// 输出开启时长分
    /// </summary>
    public ushort OutputMinutes { get; set; }

    /// <summary>
    /// 输出开启时长秒
    /// </summary>
    public ushort OutputSeconds { get; set; }

    /// <summary>
    /// 内部温度值
    /// </summary>
    public ushort InternalTemperature { get; set; }

    /// <summary>
    /// 外部温度值
    /// </summary>
    public ushort ExternalTemperature { get; set; }

    /// <summary>
    /// 按键锁
    /// </summary>
    public ushort KeyLock { get; set; }

    /// <summary>
    /// 保护状态
    /// </summary>
    public ushort ProtectionStatus { get; set; }

    /// <summary>
    /// 恒流恒压状态
    /// </summary>
    public ushort CC_CV_Status { get; set; }

    /// <summary>
    /// 输出开关状态
    /// </summary>
    public ushort OutputSwitchStatus { get; set; }

    /// <summary>
    /// 温度符号
    /// </summary>
    public ushort TemperatureSign { get; set; }

    /// <summary>
    /// 背光亮度等级
    /// </summary>
    public ushort BacklightLevel { get; set; }

    /// <summary>
    /// 息屏时间
    /// </summary>
    public ushort ScreenTimeout { get; set; }

    /// <summary>
    /// 产品型号
    /// </summary>
    public ushort ProductModel { get; set; }

    /// <summary>
    /// 固件版本号
    /// </summary>
    public ushort FirmwareVersion { get; set; }

    /// <summary>
    /// 从机地址
    /// </summary>
    public ushort SlaveAddress { get; set; }

    /// <summary>
    /// 波特率编号
    /// </summary>
    public ushort BaudRateCode { get; set; }

    /// <summary>
    /// 内部温度修正
    /// </summary>
    public ushort InternalTempCorrection { get; set; }

    /// <summary>
    /// 外部温度修正
    /// </summary>
    public ushort ExternalTempCorrection { get; set; }

    /// <summary>
    /// 蜂鸣器开关
    /// </summary>
    public ushort BuzzerSwitch { get; set; }

    /// <summary>
    /// 快捷调出数据组
    /// </summary>
    public ushort QuickDataGroup { get; set; }

    public bool IsValid { get; set; }

    public ModbusDeviceData()
    {
        Timestamp = DateTime.Now;
        IsValid = false;
    }
}